Conventionally, optical encoders, which use a light receiving element to detect a position, a moving speed, a moving direction and other data of a movable object, use two signals, an A-phase signal and a B-phase signal which are different in phase by 90 degrees from each other, to detect the position, the moving speed, the moving direction and other data of the movable object.
However, in response to a recent demand for downsizing and wire saving of the optical encoders, an optical encoder has been proposed which outputs those two signals as single A/B-phase pulse signal with a stair-step waveform so as to reduce the wiring number and to achieve downsizing.
It is disclosed in Patent Literature 1 (JP 560-88316 A) that two phase outputs from a rotary encoder are converted to get counter pulses corresponding to two phases, and one counter pulse is phase-inverted and is added to the other counter pulse, so that a stair-stepped waveform signal can be transmitted with a single output signal line.
It is also disclosed in Patent Literature 2 (JP H9-103086 A) that A-phase and B-phase sine wave signals obtained from a rotation detection circuit are converted into stair-step waveforms by voltage dividing and switching to enhance precision of rotational position sensing.
Microcomputers and other computers may not process the output signals with a stair-stepped waveform acquired from each of the aforementioned technology. In such a case, original digital signals such as A-phase and B-phase signals are needed after all. All the aforementioned technologies share the following problems. That is, an output signal with a stair-stepped waveform has a slew rate in a rising edge and a falling edge of the signal. As a result, when, for example, the output signal with a stair-stepped waveform is converted into two signals of digital values through comparison with a reference voltage corresponding to a specific threshold level, these two digital-value signals gain a delay, resulting in a shift in phase difference. When the output signal is converted into logical values in the same phase parts, a noise component is generated as a result of a delay, and this may cause detection error.
The causes of such phase delay and generation of the noise component will be explained hereinbelow in conjunction with a concrete example where two signals are generated from a stair step waveform, the two signals being an A-phase signal and a B-phase signal which are different in phase by 90 degrees from each other.
A stair-step waveform with three steps as shown in FIG. 10A will be discussed below. Both a single output waveform which is a stair-step waveform shown in FIG. 10A and A-phase and B-phase digital output waveforms shown in FIGS. 10B and 10C are ideal rectangular waves with an infinite slew rate. In this case, as shown in the block diagram of FIG. 9, an input signal S0 which is a single output waveform (stair-step waveform) is compared by a comparator 502 with a reference voltage V2 corresponding to a threshold level (2) (TH expresses a threshold level in FIG. 9 and other drawings.) to obtain an A-phase digital output signal Ach OUT. A signal (L) and an inversion signal (N) are inputted into a NOR circuit 505 for logical operation, the signal (L) being a signal outputted from a comparator 501 as a result of comparison between the input signal S0, which is the single stair-step waveform, and a reference voltage corresponding to a threshold level (1), the inversion signal (N) being a signal obtained by inverting, in a NOT circuit 504, a signal (M) outputted from a comparator 503 as a result of comparison between the input signal S0 and a reference voltage V3 corresponding to a threshold level (3). As a result, a B-phase digital output signal Bch OUT is obtained from the NOR circuit 505. Thus, when assuming that an input signal with a single output waveform has an infinite slew rate and an ideal waveform without delay, it becomes possible to obtain ideal A-phase output signal Ach OUT and B-phase output signal Bch OUT which are free from phase delay and which are different in phase by 90 degrees from each other.
However, as shown in FIG. 11A, an actual output waveform of the input signal S0 with a stair-step waveform needs finite lengths of time tr and tf for rising and falling due to an influence of the slew rate. In this case, as shown in FIGS. 11E and 11F, if signal processing is performed with the threshold levels (1) to (3) being respectively set for the steps of the stair-step waveform as shown above, a relative phase shift between the A-phase output signal Ach OUT and the B-phase output signal Bch OUT, a phase shift P within each of the A-phase and B-phase output signals, and a noise pulse N are generated. The phase shift as well as generation of the noise pulse in each of these output signals cause detection error. FIG. 11B shows a waveform of the output signal (L) from the comparator 501, FIG. 11C shows a waveform of the output signal (M) from the comparator 503, and FIG. 11D shows a waveform of the output signal (N) from the NOT circuit 504.
In view of the above discussion, a high-precision decoder is demanded which converts an output waveform signal (coded output signal with a stair-stepped waveform) outputted from, for example, a single output signal line of an optical encoder and the like into a plurality of digital output signals which are free from phase shift and generation of a noise pulse.